import React, { Component } from 'react'
import Fasong from '../util/events'

class Lefts extends Component {
  state={
      activeIndex:0
  }
   fn(ind){
     this.setState({
         activeIndex:ind
     })
    Fasong.emit('zhao',ind)
   }
  
  render() {
      let {send}=this.props
      console.log(send);
    return (
      <div>
         {
             send&&send.length?send.map((item,index)=>{
                return <li key={index}
                onClick={this.fn.bind(this,index)}
                className={index===this.state.activeIndex?"on":''}
             ><span> {item.title}
                 </span></li>
             }):''
         }
      </div>
    )
  }
}


export default Lefts